package com.xmad.ksadutils.AdSDK.AdBase;

import android.widget.FrameLayout;

import com.xmad.ksadutils.AdSDK.AdUtil;

import java.util.List;

public class AdBuilder {
    AdBaseLoad baseLoad;
    public AdBuilder(AdBaseLoad baseLoad) {
        this.baseLoad=baseLoad;
    }
//    public AdBuilder setRetry(boolean retry, List<String> ads) {
//        baseLoad.Retry  = retry;
//        baseLoad.Ads  = ads;
//        return  this;
//    }

    public AdBuilder setRetry(List<Long> ads) {
        baseLoad.KsAds  = ads;
        return  this;
    }

    public AdBuilder setId(String Id) {
        baseLoad.PGAdId  = Id;
        return  this;
    }

    public AdBuilder setId(Long Id) {
        baseLoad.KsAdId  = Id;
        return  this;
    }

    public AdBuilder setToastCode(boolean ToastCode) {
        baseLoad.ToastCode = ToastCode;
        return  this;
    }

    public AdBuilder setCache(boolean cache) {
        baseLoad.Cache = cache;
        return  this;
    }

    public AdBuilder setListener(AdListener listener) {
        baseLoad.listener = listener;
        return  this;
    }

    public AdBaseLoad show() {
        baseLoad.Show(AdUtil.getInstance().getContext(),null);
        return baseLoad;
    }


    public AdBaseLoad show(FrameLayout frameLayout) {
        baseLoad.Show(AdUtil.getInstance().getContext(),frameLayout);
        return baseLoad;
    }


    public AdBaseLoad create(){
        return baseLoad;
    }


}
